import { Component, OnInit } from '@angular/core';
import printJS from 'print-js';
import { FormBuilder } from '@angular/forms';
// import { CartService } from '../cart.service';

@Component({
  selector: 'app-form',
  templateUrl: './form.component.html',
  styleUrls: ['./form.component.css'],
})
export class FormComponent implements OnInit {
  // items = this.cartService.getItems();
  checkoutForm = this.formBuilder.group({
    name: '',
    address: '',
  });
  constructor(private formBuilder: FormBuilder) {}

  ngOnInit(): void {}
  onSubmit(): void {
    // Process checkout data here
    // this.items = this.cartService.clearCart();
    console.warn('Your order has been submitted', this.checkoutForm.value);
    this.checkoutForm.reset();
  }
}
